// Konfirmasi hapus
	$(document).foundation();  
	$('a.editorLink').click(function(){
		var target = $(this).attr('hpid');
		$('.hpid').text(target);
		
		var target = $(this).attr('nama');
		$('.nama').text(target);
		
		var target = $(this).attr('2nd');
		$('.2nd').text(target);
		
		var target = $(this).attr('3rd');
		$('.3rd').text(target);
		
		var target = $(this).attr('4th');
		$('.4th').text(target);

		var target = $(this).attr('5th');
		$('.5th').text(target);

		var target = $(this).attr('6th');
		$('.6th').text(target);
	});
	
	$(document).ajaxComplete(function(){
		$(document).foundation();  
		$('a.editorLink').click(function(){
			var link = $('.deleteUrl');
			$(link).attr('href', this.href);
			
			var target = $(this).attr('nama');
			$('.nama').text(target);
			
			var target = $(this).attr('2nd');
			$('.2nd').text(target);
			
			var target = $(this).attr('3rd');
			$('.3rd').text(target);
			
			var target = $(this).attr('4th');
			$('.4th').text(target);
			
			var target = $(this).attr('hpid');
			$('.hpid').text(target);
		});
	});
	

jQuery(window).load(function() {   
   // Page Preloader
   jQuery('#status').fadeOut();
   jQuery('#preloader').delay(350).fadeOut(function(){
      jQuery('body').delay(350).css({'overflow':'visible'});
   });
});

$(function() {
    $('#side-menu').metisMenu();
});

//Loads the correct sidebar on window load,
//collapses the sidebar on window resize.
$(function() {
    $(window).bind("load resize", function() {
        console.log($(this).width())
        if ($(this).width() < 768) {
            $('div.sidebar-collapse').addClass('collapse')
        } else {
            $('div.sidebar-collapse').removeClass('collapse')
        }
    })
})
